/* 
 * File:   pq.h
 * Author: aishwarya
 *
 * Created on March 12, 2011, 4:02 AM
 * Priority Queue - Interface definition
 */

#ifndef PQ_H
#define	PQ_H

#ifdef	__cplusplus
extern "C" {
#endif

#include "heap.h"

    typedef struct _priority_queue {
        struct _priority_queue *THIS;
        BINARY_HEAP heap;
    } PQ, *PQPTR;

    void pq_init(PQ *q, size_t initial_size, size_t ele_size, KEYCMP k, DATACPY d, DELNODE n, PRINTNODE p);
    int pq_enqueue(PQ *q, const void *n, int id);
    int pq_dequeue(PQ *q, void *n);
    int pq_peek(PQ *q, void *n);
    int pq_decrease_priority(PQ *q, void *n, int id);
    void pq_delete(PQ *q);
    int is_pq_empty(PQ *q);

#ifdef	__cplusplus
}
#endif

#endif	/* PQ_H */

